/**
 * 给定N，问是否存在x，满足：
 * x^4+x^3+x^2+x+1 == N
 * 从1开始，挨个枚举即可
 */
#include <bits/stdc++.h>
using namespace std;

#include <bits/extc++.h>

using Real = long double;
using llt = long long;
using pii = pair<int, int>;
using vi = vector<int>;

llt const MOD = 998244353LL;

llt N;

llt f(llt x){return x*(x*(x*(x + 1) + 1) + 1) + 1;}

bool proc(){
    for(llt x=1;;++x){
        auto tmp = f(x);
        if(tmp == N) return true;
        if(tmp > N) return false;
    }
    assert(0);
}

int main(){
#ifndef ONLINE_JUDGE
    freopen("z.txt", "r", stdin);
#endif
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int nofakse = 1;
    // cin >> nofakse;
    while(nofakse--){
        cin >> N;
        cout << (proc() ? "Yes" : "No") << endl;
    }
    return 0;
}